<template>

  <div class="wrap" ref="wrap">
    <div @click="ck(item)" v-for="item in arr">{{ item }}</div>
  </div>

</template>

<script setup>
import { onMounted, ref } from 'vue';
import Menu from 'menu3d'

let arr = ['首页', '日历', '督察数据', '问题清单', '综合监管']

let wrap = ref()
// 正常绑定事件
const ck = (val) => {
  console.log(val);
}

onMounted(() => {
  // 使用 onMounted生命
  new Menu(wrap.value, { background: '#000', speed: 0.3 })
})

</script>

<style lang="scss" scoped>
.wrap {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #000;
  div {
    width: 100%;
    height: 80px;
    line-height: 80px;
    background-color: #ebe9e9;
    display: inline-block;
    font-weight: 1000;
    font-size: 16px;
    text-align: center;
    cursor: pointer;
  }
  >div:first-child {
    width: 100px;
  }
  >div:not(:first-child) {
    flex: 1;
  }
  div:not(:last-child){
    margin-right: 1px;
  }
}
</style>